import axios from '@/plugins/axios'
export default {
    namespaced: true,
    state() {
        return {
            data: [{ title: 'abc' }]
        }
    },
    mutations: {
        setNews(state, news) {
            state.data = news
        }
    },
    actions: {
        async load({ commit }) {
            const news = await axios.get(`news`)
            commit('setNews', news)
            console.log(news)
        }
    }
}
